package com.greenline.push.dal.pushcenter.impl;

import java.util.List;

import com.greenline.push.dal.base.BaseDAO;
import com.greenline.push.dal.pushcenter.DomainAppTemplateDAO;
import com.greenline.push.dal.pushcenter.dataobject.DomainAppTemplateDO;
import com.greenline.push.dal.query.DomainAppTemplateQuery;

public class DomainAppTemplateDAOImpl extends BaseDAO implements DomainAppTemplateDAO {

    @Override
    public Long insert(DomainAppTemplateDO appDomainTempDO) {
        return (Long) super.getSqlMapClientTemplate().insert("domainAppTemplate.insert", appDomainTempDO);
    }

    @Override
    public DomainAppTemplateDO getById(Long id) {
        return (DomainAppTemplateDO) super.getSqlMapClientTemplate().queryForObject("domainAppTemplate.find_by_id", id);
    }

    @Override
    public Integer update(DomainAppTemplateDO appDomainTempDO) {
        return super.getSqlMapClientTemplate().update("domainAppTemplate.update", appDomainTempDO);
    }

    @Override
    public Integer delete(Long id) {
        return super.getSqlMapClientTemplate().delete("domainAppTemplate.delete", id);
    }

    @Override
    public DomainAppTemplateQuery listByQuery(DomainAppTemplateQuery query) {
        return (DomainAppTemplateQuery) super.listByQuery("domainAppTemplate.list_by_query", query);
    }

    @SuppressWarnings("unchecked")
    @Override
    public List<DomainAppTemplateDO> getByDomainId(Long domainId) {
        return super.getSqlMapClientTemplate().queryForList("domainAppTemplate.find_by_domain_id", domainId);
    }

    @Override
    public Integer getPriorityByApptemplateId(Long apptemplateId) {
        return (Integer) super.getSqlMapClientTemplate().queryForObject("domainAppTemplate.get_priority_by_apptemplateId", apptemplateId);
    }

}
